﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SDT.Admin.ViewModels.ArticleCategoryIndexViewModel>" %>

<%@ Import Namespace="SDT.Lib.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Chi tiết chuyên mục bài viết
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Header" runat="server">
	Chi tiết chuyên mục bài viết
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Toolbar" runat="server">
    <%= Html.Toolbar("Thêm mới", "/ArticleCategory/Create/", "new") %>
	<%= Html.Toolbar("Sửa", string.Format("/ArticleCategory/Edit/{0}", Model.CurrentArticleCategory.ID), "edit")%>
	<%= Html.Toolbar("Xóa", string.Format("/ArticleCategory/Delete/{0}", Model.CurrentArticleCategory.ID), "delete")%>
	<%= Html.Toolbar("Quay lại", "/ArticleCategory/Index/", "back")%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%if(ViewData["MessageInfo"]==null){ %>
	<fieldset>
		<legend>Chi tiết chuyên mục</legend>
		<table class="admintable">
			<tbody>
			<tr>
				<td class="key">Tên chuyên mục</td>
				<td><%= Html.Encode(Model.CurrentArticleCategory.Name) %></td>
			</tr>
			<tr>
				<td class="key">Tên vắn tắt</td>
				<td><%= Html.Encode(Model.CurrentArticleCategory.ShortName) %></td>
			</tr>
			<tr>
				<td class="key">Mô tả</td>
				<td><%= Model.CurrentArticleCategory.Description %></td>
			</tr>
			<tr>
			    <td class ="key">Độ ưu tiên</td>
			    <td><%= Html.Encode(Model.CurrentArticleCategory.Priority) %></td>
			</tr>
			<tr>
			    <td class ="key">Trạng thái kích hoạt</td>
			    <td><%= Model.CurrentArticleCategory.ActiveYN == true ? Html.Encode("Đã kích hoạt") : Html.Encode("Chưa kích hoạt") %></td>
			</tr>
			<tr>
				<td class="key">Cập nhật lúc</td>
				<td><%= Model.CurrentArticleCategory.ModifyDate != null ? Html.Encode(String.Format("{0:g}", Model.CurrentArticleCategory.ModifyDate)) : ""%></td>
			</tr></tbody>
		 </table>
	 </fieldset>
	 <% if (Model.ChidrentArticleCategories.Count() > 0 ) { %>
	 <fieldset>
		<legend>Các chuyên mục con</legend>
		<table width="100%" class="adminlist">
			<tr>
				<th width="10" align="right">
					STT
				</th>
				<th width="30"></th>
				<th width="30"></th>
				<th>
					Tên chuyên mục
				</th>
				<th>
					Cập nhật
				</th>
				<th>
					ID
				</th>
			</tr>
		<% 
			int i = 0;
    		foreach (var item in Model.ChidrentArticleCategories) {
				i++;
		%>		
			<tr>
				<td align="right">
					<%= i.ToString() %>
				</td>
				<td align="center">
					<%= Html.ActionImage("Sửa", "icon-24-edit.png", "ArticleCategory", "Edit", new Dictionary<string, object>() { { "id", item.ID } })%>
				</td>
				 <td align="center">
					<%= Html.ActionImage("Xóa", "icon-24-delete.png", "ArticleCategory", "Delete", new Dictionary<string, object>() { { "id", item.ID } })%>
				</td>
				<td>
					<%= Html.ActionLink(item.Name, "Details", "ArticleCategory", new { id = item.ID }, null)%>
				</td>
				<td>
					<%= item.ModifyDate != null ? Html.Encode(String.Format("{0:g}", item.ModifyDate)) : ""%>
				</td>
				<td>
					<%= Html.Encode(item.ID) %>
				</td>
			</tr>
	    
		<% } %>
		</table>
	</fieldset>
	<% } %>
<% } %>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="Message" runat="server">
    <%=ViewData["MessageInfo"]!=null? "<p class='perror'>"+Html.Encode(ViewData["MessageInfo"])+"</p>":string.Empty%>  
</asp:Content>

